CC = g++
LIB = -L../lib -L../lib/lua
INCLUDE = -I../include -I../base -I../garage

CFLAG = -DLINUX -DLOG_LEVEL_LITE -DDEBUG -g -c
#CFLAG = -DLOG_LEVEL_HEAVY -c
#PROFILE = -pg
PROFILE = 
OPTIMIZE =
WARNNING = -w
LINKLIB = -lpthread -lgarage -lbase -lgtest -llua5.1 -ltiny -lm -ldl -lcurl -lidn -lz -lrt
TARGET = poplar_lib_test
OBJECTS = poplar_lib.o test_base.o test_db.o test_garage.o test_network.o

${TARGET} : ${OBJECTS}
	${CC} -o ${TARGET} ${INCLUDE} ${OBJECTS} ${LINKLIB} ${LIB}

poplar_lib.o : poplar_lib.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

test_base.o : test_base.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

test_db.o : test_db.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

test_garage.o : test_garage.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

test_network.o : test_network.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

clean :
	rm -rf *.o *.a

new:
	${MAKE} clean
	${MAKE}
